package com.spring.utils;

import org.jsoup.safety.Whitelist;

public class Constants {
	public final static String WEB_KEY_NULL = "_NULL_";
	
	/**
	 * 关键字符过滤用
	 */
	/**
	 * This whitelist allows only text nodes: all HTML will be stripped.
	 */
	
	//public final static Whitelist USER_CONTENT_FILTER_NONE = Whitelist.none();
	/**
	 * This whitelist allows a fuller range of text nodes: 
	 * 	a, b, blockquote, br, cite, code, dd, dl, dt, em, i, li, ol, p, pre, q, small, strike, strong, sub, sup, u, ul, 
	 * and appropriate attributes.
	 */
	public final static Whitelist USER_CONTENT_FILTER_BASIC = Whitelist.basic();
	
	/**
	 *   This whitelist allows only simple text formatting: b, em, i, strong, u.
	 */
	//public final static Whitelist USER_CONTENT_FILTER_SIMPLETEXT = Whitelist.simpleText();
	/**
	 *  This whitelist allows the same text tags as basic(), and also allows img tags, with appropriate attributes, 
	 *  with src pointing to http or https.
	 */
	//public final static Whitelist USER_CONTENT_FILTER_BASICWITHIMAGES = Whitelist.basicWithImages();
	
	/**
	 *   This whitelist allows a full range of text and structural body HTML: 
	 *   	a, b, blockquote, br, caption, cite, code, col, colgroup, dd, dl, dt, em, 
	 *   	h1, h2, h3, h4, h5, h6, 
	 *   	i, img, li, ol, p, pre, q, small, strike, strong, sub, sup, 
	 *   	table, tbody, td, tfoot, th, thead, tr, u, ul 
	 *   
	 */
	//public final static Whitelist USER_CONTENT_FILTER_RELAXED = Whitelist.relaxed();
	
	/**
	 * 在过滤字符USER_CONTENT_FILTER_BASIC的基础上增加了如下允许的标签
	 */
	static {
		USER_CONTENT_FILTER_BASIC.addTags("embed","object","param","span","div");
		USER_CONTENT_FILTER_BASIC.addAttributes(":all", "style", "class", "id", "name");
		USER_CONTENT_FILTER_BASIC.addAttributes("object", "width", "height","classid","codebase");	
		USER_CONTENT_FILTER_BASIC.addAttributes("param", "name", "value");
		USER_CONTENT_FILTER_BASIC.addAttributes("embed", "src","quality","width","height","allowFullScreen","allowScriptAccess","flashvars","name","type","pluginspage");
	}
	
	
	// 每页最大条数
	public final static Integer MAX_RESULT = 10;
	// 页面显示的页码数量
	public final static Integer PAGE_CODE = 5;  
	// 分页用
	public final static String SQL_PAGE_KEY = "SQL_CALC_FOUND_ROWS";
	
	// 延迟加载（计算加载层数用）
	public final static Integer LAZY_LEVEL_CON = 1;
	// 默认执行一次
	public final static Integer DEFAULT_LAZY_TIME = 1;
	
	// 防止重复提交（session变量）
	public final static String FORM_SUBMIT_SIGN = "form_submit_sign";

	// 缓存的list标志
	public final static String CACHE_LIST_SIGN = "list_";
	// 缓存的page标志
	public final static String CACHE_PAGE_SIGN = "page_";
	
	// 数据库常用状态
	public final static Integer RECORD_ON = 1; // 开启
	public final static Integer RECORD_OFF = 0; // 关闭
	public final static Integer RECORD_PID = 0; // _pid
	
	// _vercode
	public final static String VERCODE_SESSION = "vercode_session";
	public final static String VERCODE_REQUEST = "vercode_request";
	
	// registe fail message
	public final static String REGISTE_FAIL_MESSAGES = "registe_fail_message";
	
	// gf_sort 
	public final static String GF_SORT_ADMIN_PATH = "/admin/gf/";
	public final static String GF_SORT_LIST_ATTR = "gf_sort_list";
	public final static String GF_SORT_ATTR = "gf_sort";
	
	// 错误页面 error.jsp
	public final static String ERROR_ADMIN_PATH = "/admin/error";
	public final static String ERROR_MESSAGE_ATTR = "error_message";
	
	
}
